<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>
        编写一个函数，计算任意两个数字之间所能组成的奇数个数，数字必须是个位数。 比如：计算0~3之间能组成的奇数是： 01、03、11、13、21、23、31、33
    </p>
    <input type="text" placeholder="第一个数字">
    <input type="text" placeholder="第二个数字">
    <input type="button" value="计算" onclick="getResult()">
    <span id="span"></span>
    <script>
        function getResult() {
            let str = document.querySelector('input').value;
            let strTwo = document.getElementsByTagName('input')[1].value;
            let num = Number(str);
            let numTwo = Number(strTwo);
            let arr = [];
            if (num > numTwo) {
                let temp = num;
                num = numTwo;
                numTwo = temp
            }

            for (let index = num; index <= numTwo; index++) {
                for (let key = num; key <= numTwo; key++) {
                    if (key % 2 != 0)
                        arr.push(index * 10 + key);
                }
            }
            document.getElementById('span').innerHTML = arr;
        }
    </script>
</body>

</html>